<%--
  @desc: 投诉意见列表
  @author: chenw
  @create: 2014-4-29 下午 15:32
--%>
<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<form  rel="pageForm" onsubmit="return navTabSearch(this);"
	action="<c:url value='/advice/list'/>" method="post">
	<div class="searchBar" style="padding-top: 1px;">
		<ul>
			<li style="float: left; line-height: 25px;"><label>反馈时间：</label>
				<input name="start" type="text" class="date" id="start"
				datefmt="yyyy-MM-dd HH:mm:ss"
				value="<fmt:formatDate value="${query.start}" pattern="yyyy-MM-dd HH:mm:ss"/>"
				placeholder="起始时间"
				style="width: 100px; font-family: '微软雅黑 sans-serif serif';" /> - <input
				name="end" type="text" class="date"  id="end" datefmt="yyyy-MM-dd HH:mm:ss"
				value="<fmt:formatDate value="${query.end}" pattern="yyyy-MM-dd HH:mm:ss"/>"
				placeholder="结束时间"
				style="width: 100px; font-family: '微软雅黑 sans-serif serif';" /></li>
				   <li style="float: left; line-height: 25px;">
                    <label>状态：</label> 
				<select name="handler">
                    <option value="" selected="selected">全部</option>
                    <option value="1"
                            <c:if test="${query.handler==1}">selected="selected"</c:if>>未解决
                    </option>
                    <option value="2"
                            <c:if test="${query.handler==2}">selected="selected"</c:if>>已解决
                  
                </select>
				
				</li>
				
			<li>
				<div class="buttonActive" style="margin-left: 5px;">
					<div class="buttonContent">
						<button type="submit">查询</button>
					</div>
				</div>
			</li>
			<li>
				<div class="buttonActive" style="margin-left: 5px;">
					<div class="buttonContent">
						<button type="button" onclick="exportExcel()">导出</button>
					</div>
				</div>
			</li>
			<%-- <li>
				<div class="buttonActive" >
					<div class="buttonContent">
						<a href="<c:url value='/advice/view/{sel_id}'/>" target="dialog"
							width="480" height="250" mask="true" resizable="false"
							maxable="false"><span>查看明细</span></a>
					</div>
				</div>
			</li> --%>

		</ul>
	</div>
</form>
<table width="100%" class="table" layoutH="115" nowrapTD="false" >
	<thead>
		<tr>
			<th width="5%" align="center">序号</th>
			<th width="10%" align="center">联系方式</th>
			<th width="10%" align="center">登陆账号</th>
			<th width="10%" align="center">反馈时间</th>
			<th width="10%" align="center">手机机型</th>
			<th width="35%" align="center">意见反馈</th>
			<th width="5%" align="center">操作</th>
			<th width="10%" align="center">通知方式</th>
			<th width="5%" align="center">状态</th>
			
		</tr>
	</thead>
	<tbody>
		<c:forEach var="advice" items="${pager.list}" varStatus="vs">
			<tr target="sel_id" nowrapTD="false" rel="${advice.id}" ondblclick="showDialog(${advice.id})">
				<td>${vs.count+(pager.pageNum-1)*pager.numPerPage}</td>
				<td>${advice.contact}</td>
				<td>${advice.loginId}</td>
				<td><fmt:formatDate value="${advice.createTime}"
						pattern="yyyy-MM-dd HH:mm" /></td>
				<td>${advice.mobileType}</td>
				<td>${advice.content}</td>
				<td>       <c:choose>
                	<c:when test="${advice.handler==0}">
                		<a href="<c:url value='/advice/reply/${advice.id}/1'/>"
					target="dialog" rel="advice_callback" width="500" height="400"
					mask="true" resizable="false" maxable="false" title="回复意见" id="btn-login">回复</a>
                	</c:when>
                	<c:when test="${advice.handler==1}">
		                                       <a href="<c:url value='/advice/reply/${advice.id}/2'/>"
					target="dialog" rel="advice_callback" width="500" height="400"
					mask="true" resizable="false" maxable="false" title="回复意见" id="btn-login">已回复</a>
                	</c:when>
                	<c:when test="${advice.handler==2}">
		                                       <a href="<c:url value='/advice/reply/${advice.id}/2'/>"
					target="dialog" rel="advice_callback" width="500" height="400"
					mask="true" resizable="false" maxable="false" title="回复意见" id="btn-login">已回复</a>
                	</c:when>
                </c:choose>
	             </td>
					
						<td><c:if test="${advice.handler==1}">消息推送 </c:if>
						<c:if test="${advice.handler==2}">消息推送 ,短信推送</c:if>
						<c:if test="${advice.handler==0}">未推送消息</c:if></td>
							<td><c:if test="${advice.status==1}">未解决</c:if>
							<c:if test="${advice.status==2}">已解决</c:if></td>

			</tr>
		</c:forEach>
	</tbody>
</table>
<div class="panelBar">
	<div class="pages">
		<span>显示&nbsp;</span> <select id="cob_ps" class="combox"
			name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
			<option value="20">20</option>
			<option value="50">50</option>
			<option value="100">100</option>
			<option value="200">200</option>
		</select> <span>条，共${pager.total}条</span>
	</div>
	<div class="pagination" targetType="navTab" totalCount="${pager.total}"
		numPerPage="${pager.numPerPage}" pageNumShown="10"
		currentPage="${pager.pageNum}"></div>
</div>
<form id="pagerForm" method="post"
	action="<c:url value='/advice/list'/>">
	<input type="hidden" name="pageNum" value="${pager.pageNum}" /> 
	<input
            type="hidden" name="end"
            value="<fmt:formatDate value="${query.end}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
	<input
            type="hidden" name="start"
            value="<fmt:formatDate value="${query.start}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
	<input	type="hidden" name="numPerPage" value="${pager.numPerPage}" /> 
	<input type="hidden" name="handler" value="${query.handler}"/> 
	<input type="hidden" name="orderDirection" value="${query.orderDirection}" />
	
</form>
</div>


<script type="text/javascript">
function showDialog(advid){
	$.pdialog.open("<c:url value='/advice/view/"+advid+"'/>","pid","查看明细",
				{ maxable:false, mask:true, width: 480, height: 350,resizable :false});
}


function exportExcel() {
	var end=$("#end").val();
	var start=$("#start").val();
	
	
	window.location.href = "${pageContext.request.contextPath }/advice/exportExcel.xls?end="+end+"&start="+start+"&handler=${query.handler}"
}




</script>
